#include <iostream>
#include <string>

		

/*
template <typename T> 
inline T const& max (T const& a, T const& b) 
{ 
    return a < b ? b : a; 
} 
*/
template <typename T> 
inline T const& max (T a, T b) 
{ 
    return a < b ? b : a; 
} 


template<typename Ring, char* var> class UPR{
		Ring _r;
	public:
			UPR(const Ring& r) : _r(r){};
			const char* get_var(){ return var;}
			void print(){ 
					std::cout<<"Ring:"<<_r<<std::endl;
					std::cout<<"Variable:"<<var<<std::endl;
			}
};

	const char * const x="x";
	const char * const y="y";
int main() 
{ 
    std::string s;
	UPR<int, x> intx(3,x);
	intx.print();

    ::max("apple","peach");   // OK: same type 
    ::max("apple","tomato");  // ERROR: different types 
 //   ::max("apple",s);         // ERROR: different types 
} 

